class Node:
    def __init__(self, data):
        self.data = data
        self.next = None


class LinkList:
    def __init__(self):
        self.head = Node(None)

    def InitList(self, data_list):
        p = self.head
        for i in data_list:
            node = Node(i)
            p.next = node
            p = p.next

    def isEmpty(self):
        p = self.head
        if p.next is None:
            return True
        return False

    def PrintList(self):
        if self.isEmpty():
            return False
        p = self.head
        while p.next is not None:
            p = p.next
            print(p.data, ' ')


if __name__ == '__main__':
    llist = LinkList()
    llist.InitList([1, 2, 3, 4, 5, 5, 6, 7, 9])
    llist.PrintList()
